//
//  JSSComposeButton.swift
//  WeiBoItem
//
//  Created by jss on 16/4/25.
//  Copyright © 2016年 jss. All rights reserved.
//

import UIKit

class JSSComposeButton: UIButton {
    
    //如何重写一个类的属性                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
    override var highlighted:Bool {
        
        set{
            
        }
        get{
           return false
        }
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }
  
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    //设置界面
    private func setupUI() {
        
        self.imageView?.contentMode = .Center
        self.titleLabel?.textAlignment = .Center
        
    }
    
    override func layoutSubviews() {
         super.layoutSubviews()
        
        self.imageView?.frame = CGRectMake(0, 0, self.frame.width, self.frame.width)
        
        //print(self.imageView?.frame.width)
       // print(self.imageView?.frame.height)
        
        
        self.titleLabel?.frame = CGRectMake(0, self.frame.width, self.frame.width, self.frame.height - self.frame.width)
    }
}
